<?php 
session_start();
if ($_SESSION['auth'] != true && $_SESSION['rule'] != "READER") {
	die('Not log in');
}
include("includes/reader_lib.php");
$s = getReaderSetting($_SESSION['userdata']['username']);
?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="itelement.css" rel="stylesheet" type="text/css" />
<script src="script/jquery.js"></script>
<script src="script/flooble.js"></script>
<script language="javascript" type="text/javascript">
$(document).ready (
	function(){
		$('#color').click(
		function(){
			pickColor('color', function(color){$('#color').attr({bgcolor: color});});
		});
		$('#saveSetting').click(
		/*$('form').submit(*/
			function(){
				var serialize = $('form').serialize();
				$('#status').show('fast');
				$('#status').text('Wait server...');
				$.get("reader_operation.php?action=save_setting&"+serialize,
				function(data){
					$('body').attr( 'bgcolor', $('#colorfield').val() );
					$('#status').text(data);
					$('#status').hide(500);
				} );
			}
		);
	}
);
</script>
<style type="text/css">
<!--
.main { padding:30px 0 0 0; }
-->
</style>
<!--[if lte IE 6]>
<style type="text/css">
.main{ padding-top:0px;}
</style>
<![endif]-->
</head>

<body>
<div class="main">
<form id="setting">
	<div id="viewer-header2">
		<table width="100%">
			<tr><td class="viewer-head-left">Setting</td></tr>
		</table>
	</div>

<div class="input">News Per Page
	<div>
		<input style="width:100%" name="newsperpage" type="text" value="<?php echo $s['newsperpage'];?>">
	</div>
</div>
<div class="input">Display
	<div>
	<input type="radio" name="display" value="1" <?php if($s['fullmode'] == 1)echo "checked"; ?>>Full<br />
	<input type="radio" name="display" value="0" <?php if($s['fullmode'] == 0)echo "checked"; ?>>Mini<br />
	</div>
</div>
<div id="status"></div>
<input id="saveSetting" type="button" value="Save" />
</form>
</div>
</body>
</html>
